package routes

import (
	"github.com/gin-gonic/gin"
	"meituan/apps/admin"
	"meituan/apps/common"
	"meituan/apps/mine"
	"meituan/apps/order"
	"meituan/apps/rider"
	"meituan/apps/shop"
	"meituan/apps/upload"
	"meituan/middleware"
	"meituan/utils/config"
)

func RegisterRouter(app *gin.Engine) {
	baseConfig, _ := config.LoadConfig()
	app.Static("/uploads", baseConfig.Gin.Upload.Path)
	v1Api := app.Group("/v1/api")
	{
		v1Api.Use(middleware.VersionControl)
		admin.IncludeAdminRouter(v1Api, "/admin")
		common.IncludeCommonRouter(v1Api, "/common")
		mine.IncludeOrderRouter(v1Api, "/mine")
		order.IncludeOrderRouter(v1Api, "/order")
		rider.IncludeRiderRouter(v1Api, "/rider")
		shop.IncludeShopRouter(v1Api, "/shop")
		upload.IncludeUploadRouter(v1Api, "/upload")
	}
}

func RegisterStatic() {

}
